#!/usr/bin/env python3

import os
import sys
sys.path.append(f'{os.path.dirname(os.path.realpath(__file__))}/../utils')
sys.path.append(f'{os.path.dirname(os.path.realpath(__file__))}/../operators')
from pprint import pprint
import wrf_operators as wrf
from utils import cmd_args, cli, parse_config, run

args = cmd_args()

config = parse_config(args.config_json)

def gen_nature_run():
	work_dir = f'{args.work_root}/{config["tag"]}'
	wrf.config_wps(work_dir, args.wps_root, args.geog_root, config, args)
	wrf.run_wps_geogrid(work_dir, args.wps_root, config, args)
	wrf.run_wps_ungrib_metgrid(work_dir, args.wps_root, args.bkg_root, config, args)

	wrf.config_wrf(work_dir, args.wrf_root, config, args, work_dir + '/wps')
	wrf.run_real(work_dir, args.wrf_root, config, args, work_dir + '/wps')

	wrf.run_wrf(work_dir, args.wrf_root, config, args)

gen_nature_run()
